package com.guozcc.bootweb.api.mapper;

import com.guozcc.bootweb.api.bean.User;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface UserMapper {


    public User getUserById(int userid);

    @Select("select * from user where username=#{username}")
    public List<User> getUserByUserName(String  UserName);


    public void insertUser(User user);

    @Insert("insert into  user (`username`,`age`,`sex`) values(#{username},#{age},#{sex})")
    @Options(useGeneratedKeys = true,keyProperty = "userid")
    public void insertUserAnno(User user);

    public void updateUser(User user);

    @Delete("delete from user where userid=#{userid}")
    public void deleteUser(User user);



}
